package ${package};

import com.stream.fbs.fsp.base.core.annotation.Json;
import com.stream.fbs.fsp.base.core.annotation.ResponseJson;
import com.stream.plume.bill.core.annotation.Member;
import com.stream.plume.bill.intf.enums.ErrorCodeEnum;
import com.stream.plume.bill.intf.service.I${controllerName}Service;
import com.stream.plume.bill.intf.vo.AppRequestVo;
import com.stream.plume.bill.intf.vo.ResponseVo;
import com.stream.plume.bill.intf.vo.UserInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

<#assign dateTime = .now>
/**
*
*
* @since ${dateTime?string["yyyy-MM-dd HH:mm:ss"]}
*/

@Controller
@RequestMapping("/app")
public class ${controllerName}${mapperSuffix} {

    @Autowired
    private I${controllerName}Service i${controllerName}Service;

    /**
    *
    * @param requestVo
    * @param userInfoVo
    * @return
    */
    @RequestMapping(value = "/${controllerName?cap_first}/test", method = RequestMethod.POST)
    @ResponseJson
    public ResponseVo ${controllerName?cap_first}(@Json AppRequestVo requestVo, @Member UserInfoVo userInfoVo) {
        if (requestVo == null ) {
            return new ResponseVo(ErrorCodeEnum.PARAM_IS_NULL);
        }
        if(userInfoVo == null || StringUtils.isEmpty(userInfoVo.getMemberId())) {
            return new ResponseVo(ErrorCodeEnum.MEMBER_NOT_LOGIN);
        }

    return i${controllerName}Service.${controllerName?cap_first}(requestVo, userInfoVo);
    }

}
